#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    int n;
    cin>>n;
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a==c&&b==d)cout<<"YES";
    else if(a==c&&b!=d)cout<<"NO";
    else 
    {
        int x1,x2;
        if(a==1)x1=b,x2=d;
        else x1=d,x2=b;
        if((x1==x2+1)||(x1+1==x2&&n-x2>1))cout<<"YES";
        else cout<<"NO";
    }
}
signed main()
{
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    int T=1;
    //cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}